---
sidebar_label: Write Migrations manually (config v2)
sidebar_position: 2
description: Write manual Migrations for Hasura GraphQL Engine
keywords:
  - hasura
  - docs
  - migration
  - manual
---

# Write Migrations Manually (config v2)

## Introduction

While the Hasura Console can auto generate Migrations for every action,
sometimes you might want to write the Migrations yourself, by hand.
Using the Hasura CLI, you can bootstrap these migration files and write
the SQL for the Postgres schema.

:::info Note

For `config v3`, see [Writing Migrations manually](/migrations-metadata-seeds/manage-migrations.mdx#create-manual-migrations).

:::

## Create migration manually

1.  Set up the migration files:

    ```bash
    hasura migrate create <name-of-migration>
    ```

    This command will create up and down migration SQL files in the
    `migrations` directory.

2.  Edit the file and add your migration actions. For the file format
    and instructions on what actions can be added, refer to
    [migration file format](/migrations-metadata-seeds/legacy-configs/config-v2/reference/migration-file-format.mdx).

3.  The corresponding Hasura Metadata changes, if any, can be made
    directly in the appropriate Metadata file in the `/metadata`
    directory, refer to [Metadata format](/migrations-metadata-seeds/legacy-configs/config-v2/reference/metadata-format.mdx).

4.  Apply the Migration and Metadata:

    ```bash
    hasura migrate apply
    hasura metadata apply
    ```
